<template>
	<view class="waikuang">
		<view class="neirkuan" v-if="dqpaid.length > 0">
			<view class="jvzhong">
				<view>你的排队号是</view>
				<view class="haoma">1345567</view>
			</view>
			<view class="xinxi">
				<view>你选的是:{{lfsData.name}}理发师为你服务</view>
				<view class="jiang">你前面还有4人在等待</view>
			</view>
		</view>
		<view class="neirkuan" style="text-align: center;" v-else>
			暂无排队
		</view>
		<view class="paiduiqk" v-if="dqpaid.length > 0">
			<view class="paidqk">
				<view :class="fal.fwzt==1?'paihao dqyh':fal.kehu.id == userInfo.id ?'paihao my':'paihao paid'" v-for="fal in dqpaid" :key="fal.id">
					<view class="jbxx">
						<view class="xingm">{{fal.kehu.phone}}</view>
						<!-- <view>{{fal.ximgm}}</view> -->
						<view>剪头发</view>
					</view>
					<!-- <view>{{fal.qhfs}}</view> -->
					<view>APP排队</view>
				</view>
				<!-- <view class="mypai">扫码从新排队</view> -->
				<view class="mypai" @click="goMdxisngq">从新排队</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lfsid: "",
				dqpaid: [],
				lfsData: {},
				userInfo: {},
				myPdIndex: null,
			}
		},
		onLoad() {
		},
		onShow() {
			this.userInfo = uni.getStorageSync('user_key');
			if(uni.getStorageSync('lfsid')) {
				this.getDqpaid();
			};
		},
		methods: {
			getDqpaid() {
				uni.request({
					url: getApp().globalData.url+'/client/GetLfsPdui',
					data:{
						lfsid: uni.getStorageSync('lfsid'),
						// lx: "",
					},
					method: "GET",
					header: {
						"Content-Type": "application/json"
					},
					success: (res) => {
						// console.log(333,res);
						if(res.data.code == 200) {
							this.dqpaid = res.data.data;
							this.lfsData = res.data[0].lsf;
							this.dqpaid.forEach((item,index) => {
								if(item.kehu.id == this.userInfo.id) {
									this.myPdIndex = index;
								}
							})
						}
					}
				})
			},
			goMdxisngq() {
				uni.navigateTo({
					url:'../mdxisngq/mdxisngq?id='+this.dqpaid[0].mendian.id,
				})
			},
		}
	}
</script>

<style>
	page{
		background: #f0f0f0;
	}
</style>
<style  lang="scss" scoped>
	.waikuang{
		width: 710rpx;
		padding: 20rpx;
		.neirkuan{
			background-color: #fff;
			padding: 30rpx;
			border-radius: 20rpx;
			.jvzhong{
				text-align: center;
				color: #85888d;
				.haoma{
					font-size: 50rpx;
					color: #111111;
					font-weight: bold;
					margin: 30rpx 0;
				}
			}
			.xinxi{
				font-size: 28rpx;
				color: #2C405A;
				.jiang{
					margin-top: 20rpx;
				}
			}
		}
		.paiduiqk{
			border-radius: 20rpx;
			padding: 20rpx;
			background: #ffffff;
			margin-top: 20rpx;
			.paidqk{
				width: 670rpx;
				// border-top: solid 1rpx #d1d1d1;
				.dqyh{
					background: #ffb8ea;
					color: #ff007f;
				}
				.paid{
					background: #e5e5e5;
					color: #595b5f;
				}
				.my{
					background: #d2eae2;
					color: #719c93;
				}
				.mypai{
					margin-top: 20rpx;
					border-radius: 40rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					padding: 20rpx 40rpx;
					font-size: 28rpx;
					background: #ff007f;
					color: #ffffff;
				}
				.paihao{
					margin-top: 20rpx;
					border-radius: 40rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding: 20rpx 40rpx;
					font-size: 28rpx;
					.jbxx{
						display: flex;
						align-items: center;
						.xingm{
							font-weight: bold;
							margin-right: 10rpx;
						}
					}
				}
			}
			
		}
	}
	
</style>
